package Sequence;

public class TestSequence {
    public static void main(String[] args) {
        MySequence mySequence = new MySequence();

        System.out.println("=====尾插=====");
        mySequence.add(12);
        mySequence.add(23);
        mySequence.add(34);
        mySequence.add(45);
        mySequence.add(56);
        mySequence.display();

        System.out.println("=====指定插=====");
        mySequence.add(3,55);
        mySequence.display();
        //mySequence.add(7,99);

        System.out.println("=====找值=====");
        System.out.println(mySequence.contain(23));
        System.out.println(mySequence.contain(99));

        System.out.println("=====元素对应位置=====");
        System.out.println(mySequence.indexOf(34));
        System.out.println(mySequence.indexOf(99));

        System.out.println("=====位置对应元素");
        System.out.println(mySequence.get(3));
        //System.out.println(mySequence.get(8));

        System.out.println("=====重设=====");
        mySequence.set(2,66);
        mySequence.display();

        System.out.println("=====删一个=====");
        mySequence.remove(12);
        mySequence.display();
        mySequence.remove2(23);
        mySequence.display();

        System.out.println("=====指定全删=====");
        mySequence.add(12);
        mySequence.add(12);
        mySequence.add(12);
        mySequence.add(12);
        mySequence.display();
        mySequence.removeAll2(12);
        mySequence.display();

        System.out.println("=====清空顺序表=====");
        mySequence.clear();
        mySequence.display();
    }
}
